//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
//
// Allow multiple inclusion.



    MDILHELPER(MDIL_HELP_UNDEF,  CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)

    /* Arithmetic helpers */

    MDILHELPER(MDIL_HELP_DIV,    CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_MOD,    CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_UDIV,   CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_UMOD,   CORINFO_HELP_SIG_8_STACK)

#if !defined(_WIN64)
    MDILHELPER(MDIL_HELP_LLSH,   CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_LRSH,   CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_LRSZ,   CORINFO_HELP_SIG_REG_ONLY)
#else
    MDILHELPER(MDIL_HELP_LLSH,   CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_LRSH,   CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_LRSZ,   CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
#endif
    MDILHELPER(MDIL_HELP_LMUL,         CORINFO_HELP_SIG_16_STACK)
    MDILHELPER(MDIL_HELP_LMUL_OVF,     CORINFO_HELP_SIG_16_STACK)
    MDILHELPER(MDIL_HELP_ULMUL_OVF,    CORINFO_HELP_SIG_16_STACK)
    MDILHELPER(MDIL_HELP_LDIV,         CORINFO_HELP_SIG_16_STACK)
    MDILHELPER(MDIL_HELP_LMOD,         CORINFO_HELP_SIG_16_STACK)
    MDILHELPER(MDIL_HELP_ULDIV,        CORINFO_HELP_SIG_16_STACK)
    MDILHELPER(MDIL_HELP_ULMOD,        CORINFO_HELP_SIG_16_STACK)
    MDILHELPER(MDIL_HELP_LNG2DBL,      CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_ULNG2DBL,     CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_DBL2INT,      CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_DBL2INT_OVF,  CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_DBL2LNG,      CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_DBL2LNG_OVF,  CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_DBL2UINT,     CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_DBL2UINT_OVF, CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_DBL2ULNG,     CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_DBL2ULNG_OVF, CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_FLTREM,       CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_DBLREM,       CORINFO_HELP_SIG_16_STACK)
    MDILHELPER(MDIL_HELP_FLTROUND,     CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_DBLROUND,     CORINFO_HELP_SIG_16_STACK)

#ifdef FEATURE_REMOTING
    MDILHELPER(MDIL_HELP_NEW_CROSSCONTEXT, CORINFO_HELP_SIG_REG_ONLY)
#else
    MDILHELPER(MDIL_HELP_NEW_CROSSCONTEXT, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
#endif
    MDILHELPER(MDIL_HELP_NEWFAST,          CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_NEWSFAST,         CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_NEWSFAST_ALIGN8,  CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_NEW_MDARR,        CORINFO_HELP_SIG_8_VA)

    MDILHELPER(MDIL_HELP_STRCNS,           CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_INITCLASS,        CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_INITINSTCLASS,    CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_ISINSTANCEOFINTERFACE,  CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_ISINSTANCEOFARRAY,      CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_ISINSTANCEOFCLASS,      CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_CHKCASTINTERFACE,       CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_CHKCASTARRAY,           CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_CHKCASTCLASS,           CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_CHKCASTCLASS_SPECIAL,   CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_UNBOX_NULLABLE,   CORINFO_HELP_SIG_4_STACK)
    MDILHELPER(MDIL_HELP_GETREFANY,        CORINFO_HELP_SIG_8_STACK)

    MDILHELPER(MDIL_HELP_ARRADDR_ST,       CORINFO_HELP_SIG_4_STACK)
    MDILHELPER(MDIL_HELP_LDELEMA_REF,      CORINFO_HELP_SIG_4_STACK)

    MDILHELPER(MDIL_HELP_USER_BREAKPOINT,  CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_RNGCHKFAIL,       CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_OVERFLOW,         CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_INTERNALTHROW,            CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_VERIFICATION,             CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_SEC_UNMGDCODE_EXCPT,      CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_FAIL_FAST,                CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_METHOD_ACCESS_EXCEPTION,  CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_FIELD_ACCESS_EXCEPTION,   CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_CLASS_ACCESS_EXCEPTION,   CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_ENDCATCH,         CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)

    MDILHELPER(MDIL_HELP_MON_ENTER,        CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_MON_EXIT,         CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_MON_ENTER_STATIC, CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_MON_EXIT_STATIC,  CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_GETCLASSFROMMETHODPARAM,  CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_GETSYNCFROMCLASSHANDLE,   CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_SECURITY_PROLOG,          CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_SECURITY_PROLOG_FRAMED,   CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_METHOD_ACCESS_CHECK,      CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_FIELD_ACCESS_CHECK,       CORINFO_HELP_SIG_4_STACK)
    MDILHELPER(MDIL_HELP_CLASS_ACCESS_CHECK,       CORINFO_HELP_SIG_4_STACK)

    MDILHELPER(MDIL_HELP_DELEGATE_SECURITY_CHECK,  CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_VERIFICATION_RUNTIME_CHECK, CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_STOP_FOR_GC,  CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_POLL_GC,      CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_STRESS_GC,    CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_CHECK_OBJ,    CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_ASSIGN_REF, CORINFO_HELP_SIG_NO_ALIGN_STUB)

    MDILHELPER(MDIL_HELP_CHECKED_ASSIGN_REF, CORINFO_HELP_SIG_NO_ALIGN_STUB)

    MDILHELPER(MDIL_HELP_ASSIGN_REF_ENSURE_NONHEAP, CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_ASSIGN_BYREF,   CORINFO_HELP_SIG_NO_ALIGN_STUB)

    MDILHELPER(MDIL_HELP_ASSIGN_STRUCT,  CORINFO_HELP_SIG_4_STACK)

    MDILHELPER(MDIL_HELP_GETFIELD8,      CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_SETFIELD8,      CORINFO_HELP_SIG_4_STACK)
    MDILHELPER(MDIL_HELP_GETFIELD16,     CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_SETFIELD16,     CORINFO_HELP_SIG_4_STACK)
    MDILHELPER(MDIL_HELP_GETFIELD32,     CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_SETFIELD32,     CORINFO_HELP_SIG_4_STACK)
    MDILHELPER(MDIL_HELP_GETFIELD64,     CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_SETFIELD64,     CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_GETFIELDOBJ,    CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_SETFIELDOBJ,    CORINFO_HELP_SIG_4_STACK)
    MDILHELPER(MDIL_HELP_GETFIELDSTRUCT, CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_SETFIELDSTRUCT, CORINFO_HELP_SIG_8_STACK)
    MDILHELPER(MDIL_HELP_GETFIELDFLOAT,  CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_SETFIELDFLOAT,  CORINFO_HELP_SIG_4_STACK)
    MDILHELPER(MDIL_HELP_GETFIELDDOUBLE, CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_SETFIELDDOUBLE, CORINFO_HELP_SIG_8_STACK)

    MDILHELPER(MDIL_HELP_GETFIELDADDR,   CORINFO_HELP_SIG_REG_ONLY)

#ifdef FEATURE_REMOTING
    MDILHELPER(MDIL_HELP_GETSTATICFIELDADDR_CONTEXT, CORINFO_HELP_SIG_REG_ONLY)
#else
    MDILHELPER(MDIL_HELP_GETSTATICFIELDADDR_CONTEXT, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
#endif
    // TLS
#ifdef FEATURE_MIXEDMODE
    MDILHELPER(MDIL_HELP_GETSTATICFIELDADDR_TLS, CORINFO_HELP_SIG_REG_ONLY)
#else // FEATURE_MIXEDMODE
    MDILHELPER(MDIL_HELP_GETSTATICFIELDADDR_TLS, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
#endif // FEATURE_MIXEDMODE

    MDILHELPER(MDIL_HELP_DBG_IS_JUST_MY_CODE, CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_PROF_FCN_ENTER,     CORINFO_HELP_SIG_4_STACK)
    MDILHELPER(MDIL_HELP_PROF_FCN_LEAVE,     CORINFO_HELP_SIG_4_STACK)
    MDILHELPER(MDIL_HELP_PROF_FCN_TAILCALL,  CORINFO_HELP_SIG_4_STACK)

    MDILHELPER(MDIL_HELP_BBT_FCN_ENTER, CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_PINVOKE_CALLI, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_TAILCALL,      CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_GETCURRENTMANAGEDTHREADID, CORINFO_HELP_SIG_REG_ONLY)

#ifdef _WIN64
    MDILHELPER(MDIL_HELP_INIT_PINVOKE_FRAME,   CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_CHECK_PINVOKE_DOMAIN, CORINFO_HELP_SIG_UNDEF)
#else
    MDILHELPER(MDIL_HELP_INIT_PINVOKE_FRAME,   CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_CHECK_PINVOKE_DOMAIN, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
#endif

#ifdef _TARGET_X86_
    MDILHELPER(MDIL_HELP_MEMSET, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_MEMCPY, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
#else
    MDILHELPER(MDIL_HELP_MEMSET, CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_MEMCPY, CORINFO_HELP_SIG_REG_ONLY)
#endif

    MDILHELPER(MDIL_HELP_RUNTIMEHANDLE_METHOD,               CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_RUNTIMEHANDLE_METHOD_LOG,           CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_RUNTIMEHANDLE_CLASS,                CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_RUNTIMEHANDLE_CLASS_LOG,            CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE,    CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_METHODDESC_TO_RUNTIMEMETHODHANDLE,  CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_FIELDDESC_TO_RUNTIMEFIELDHANDLE,    CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_TYPEHANDLE_TO_RUNTIMETYPE,          CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_METHODDESC_TO_STUBRUNTIMEMETHOD,    CORINFO_HELP_SIG_REG_ONLY)
    MDILHELPER(MDIL_HELP_FIELDDESC_TO_STUBRUNTIMEFIELD,      CORINFO_HELP_SIG_REG_ONLY)

    MDILHELPER(MDIL_HELP_VIRTUAL_FUNC_PTR, CORINFO_HELP_SIG_4_STACK)

    MDILHELPER(MDIL_HELP_EE_PRESTUB,       CORINFO_HELP_SIG_NO_ALIGN_STUB)

#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_) || defined(_TARGET_ARM_)
    MDILHELPER(MDIL_HELP_EE_PRECODE_FIXUP, CORINFO_HELP_SIG_NO_ALIGN_STUB )
#else
    MDILHELPER(MDIL_HELP_EE_PRECODE_FIXUP, CORINFO_HELP_SIG_NO_ALIGN_STUB)
#endif

    MDILHELPER(MDIL_HELP_EE_PINVOKE_FIXUP, CORINFO_HELP_SIG_NO_ALIGN_STUB)

    MDILHELPER(MDIL_HELP_EE_VSD_FIXUP,      CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_EE_EXTERNAL_FIXUP, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_EE_VTABLE_FIXUP,   CORINFO_HELP_SIG_NO_ALIGN_STUB)

#if (defined(_TARGET_X86_) || defined(_TARGET_ARM_)) && defined(FEATURE_REMOTING)
    MDILHELPER(MDIL_HELP_EE_REMOTING_THUNK, CORINFO_HELP_SIG_UNDEF)
#else
    MDILHELPER(MDIL_HELP_EE_REMOTING_THUNK, CORINFO_HELP_SIG_UNDEF)
#endif

    MDILHELPER(MDIL_HELP_EE_PERSONALITY_ROUTINE, CORINFO_HELP_SIG_UNDEF)


#if defined(_TARGET_X86_) || defined(_HOST_X86_) || defined(REDHAWK) 
    MDILHELPER(MDIL_HELP_ASSIGN_REF_EAX, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_ASSIGN_REF_EBX, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_ASSIGN_REF_ECX, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_ASSIGN_REF_ESI, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_ASSIGN_REF_EDI, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_ASSIGN_REF_EBP, CORINFO_HELP_SIG_NO_ALIGN_STUB)

    MDILHELPER(MDIL_HELP_CHECKED_ASSIGN_REF_EAX, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_CHECKED_ASSIGN_REF_EBX, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_CHECKED_ASSIGN_REF_ECX, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_CHECKED_ASSIGN_REF_ESI, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_CHECKED_ASSIGN_REF_EDI, CORINFO_HELP_SIG_NO_ALIGN_STUB)
    MDILHELPER(MDIL_HELP_CHECKED_ASSIGN_REF_EBP, CORINFO_HELP_SIG_NO_ALIGN_STUB)
#endif


#if defined(_TARGET_ARM_)
    MDILHELPER(MDIL_HELP_ALLOCA, CORINFO_HELP_SIG_UNDEF)
#endif // _TARGET_ARM_
#if !defined(_TARGET_X86_)
    MDILHELPER(MDIL_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET,CORINFO_HELP_SIG_UNDEF)
#endif

#ifdef REDHAWK
     // we don't have any "signature" definitions for REDHAWK specific helpers;
     // they are not based on CLR's corinfo.h
#error Need "signatures" for REDHAWK specific helpers
#endif // REDHAWK

